// #ifndef ACTIVITYMONITOR_H
// #define ACTIVITYMONITOR_H

// #include <QMainWindow>

// namespace Ui {
// class ActivityMonitor;
// }

// class ActivityMonitor : public QMainWindow
// {
//     Q_OBJECT

// public:
//     explicit ActivityMonitor(QWidget *parent = nullptr);
//     ~ActivityMonitor();

// private:
//     Ui::ActivityMonitor *ui;
// };

// #endif // ACTIVITYMONITOR_H

// activitymonitor.h
#ifndef ACTIVITYMONITOR_H
#define ACTIVITYMONITOR_H

#include <QMainWindow>
#include <QPoint>
#include <QRect>
#include <QFile>
#include <QTextStream>

QT_BEGIN_NAMESPACE
namespace Ui {
class ActivityMonitor;
}
QT_END_NAMESPACE

class QTimer;

class ActivityMonitor : public QMainWindow
{
    Q_OBJECT

public:
    explicit ActivityMonitor(QWidget *parent = nullptr);
    ~ActivityMonitor();

protected:
    void mouseMoveEvent(QMouseEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;

private:
    QRect getCombinedScreenGeometry();
    void checkSystemStatus();
    void logEvent(const QString &event);

    Ui::ActivityMonitor *ui;

    QTimer *monitorTimer;

    QPoint lastMousePos;
    QRect lastScreenGeometry;

    bool mouseMoved;
    bool keyPressed;
    bool screenChanged;

    QFile logFile;
    QTextStream logStream;
};

#endif // ACTIVITYMONITOR_H
